//
// Created by wuzhe on 2022/4/18.
//

#include "InRoomState.h"
#include "OnlineState.h"

InRoomState::InRoomState(Player &player):PlayerState(player, PLAYER_STATUS::IN_ROOM) {
    player.updatePlayerInfo();
}

PlayerState *InRoomState::getTalk(std::string msg) {
    player.sendMsg(msg);
    return nullptr;
}

PlayerState *InRoomState::getExitRoom(int roomId) {
    player.onExitRoom(roomId);
    INFO(std::string("player ") + player.IP + " status changed: in room->online");
    return new OnlineState(player);
}
